import api from '@/common/request/index.js'
const state = {
	title: null,
    status: null
}
const mutations = {
    set_title(state, payload) {
        state.title = payload
    }
}
const actions = {	
	luckdraw({commit, state}, payload) {
        return new Promise((resolve, reject) => {
            api('game.luckdraw', payload).then(res => {
                if (res.status == 1) {
                    state.title = res.data
                }
                if (res.status != 1) {
                    state.title = res.info;
                }
                state.status = res.status
                resolve(res);
            })
        })
    }
}
export default {
	namespaced: true,
	state,
	mutations,
	actions
}
